/*
 * Copyright (c) 2023 Huawei Technologies Co., Ltd.
 * openUBMC is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *         http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */

#include "awm_m11p_card.h"
#include <mc/core/timer.h>
#include <mc/log.h>
#include <thread>
#include <vector>

namespace dev {

// 实现pcie_gpu_card的虚函数
bool awm_m11p_card::start() {
    return true;
}

// 实现pcie_gpu_card的虚函数
bool awm_m11p_card::stop() {
    return true;
}

bool awm_m11p_card::replace_dynamic_property(mc::mutable_dict& object, const mc::dict& connector) {
    m_pcie_device.replace_dynamic_property(object, connector);
    return true;
}

// 实现pcie_gpu_card的虚函数
bool awm_m11p_card::init(mc::mutable_dict& csr_object, const mc::dict& connector) {
    try {
        replace_dynamic_property(csr_object, connector);
        from_variant(csr_object, *this);
    } catch (const std::exception& e) {
        elog("awm_m11p_card init failed, exception: ${exception}", ("exception", e.what()));
        return false;
    }
    return true;
}

} // namespace dev

MC_REFLECT(dev::awm_m11p_card,
           ((SystemId, "SystemId"))((m_pcie_device, "bmc.dev.PCIeDevice"))((m_pcie_card,
                                                                            "bmc.dev.PCIeCard")))